Skip to content

[5.x] Attempt #3 to fix the playwright tests#1227

Merged
royduin merged 11 commits intomasterfrom
bugfix/playwright-3
Mar 20, 2026
Merged

[5.x] Attempt #3 to fix the playwright tests#1227
royduin merged 11 commits intomasterfrom
bugfix/playwright-3

Conversation

@Jade-GG
Copy link
Collaborator

@Jade-GG Jade-GG commented Mar 12, 2026

ref: RAP-1864

The playwright tests were failing left and right because, apparently, the scrolling caused very small movements of elements in certain browsers (especially on mobile). It also caused the masks (e.g. over the copyright year) to sometimes be misaligned. This made the tests unreliable.

By replacing the scroll with code that directly loads in any lazily loaded things, we don't need to worry about scroll-related issues. This also meant implementing a trick that makes sure every lazily-loaded image gets loaded, and moving some timeouts around to make sure all the browsers wait enough time for all of the lazy components.

@Jade-GG Jade-GG force-pushed the bugfix/playwright-3 branch from daa14e9 to 28f6e0e Compare March 12, 2026 14:34
@Jade-GG Jade-GG force-pushed the bugfix/playwright-3 branch from 777c88d to 811bc69 Compare March 13, 2026 12:35
@Jade-GG Jade-GG force-pushed the bugfix/playwright-3 branch from a337562 to 2b45881 Compare March 13, 2026 14:46
@Jade-GG Jade-GG marked this pull request as ready for review March 16, 2026 11:46
async loadLazy() {
await this.page.waitForLoadState('networkidle')
await this.page.evaluate(() => window.$emit('load-lazy'))
await this.page.waitForTimeout(250)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get rid of these timeouts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The whole issue with images not being loaded in is because these timeouts were missing. I had a low timeout at first, but then it was semi-random when images loaded in or not. This was the only consistent solution.

@royduin royduin mentioned this pull request Mar 20, 2026
@royduin
Copy link
Member

royduin commented Mar 20, 2026

Let's see how this turns out, merging

@royduin royduin merged commit 449a02a into master Mar 20, 2026
15 checks passed
@royduin royduin deleted the bugfix/playwright-3 branch March 20, 2026 12:53
@royduin
Copy link
Member

royduin commented Mar 20, 2026

Could you add some more information? What, why, etc?

@royduin royduin mentioned this pull request Mar 20, 2026
@Jade-GG
Copy link
Collaborator Author

Jade-GG commented Mar 20, 2026

I've updated the description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants